export default {
  data () {
    return {
    }
  },
  methods: {
    backTop () {
      const timer = setInterval(function () {
        const osTop = document.documentElement.scrollTop || document.body.scrollTop
        const ispeed = Math.floor(-osTop / 5)
        document.documentElement.scrollTop = document.body.scrollTop = osTop + ispeed
        if (osTop === 0) {
          clearInterval(timer)
        }
      }, 30)
    }
  },
  render () {
    return (
      <div class='titleBox'>
        <span class='iconBox'>
          <i class='iconfont icon-fanhuidingbu1' onClick={this.backTop}></i>
          <p>回顶</p>
        </span>
      </div>
    )
  }
}
